<template>
  <div class="user-list">
    <MySearch></MySearch>
    <el-table
      ref="multipleTable"
      :data="tableData"
      tooltip-effect="dark"
      style="width: 100%"
      @selection-change="handleSelectionChange">
      <el-table-column
        align="center"
        type="selection"
        width="55">
      </el-table-column>
      <el-table-column
        align="center"
        label="日期"
        width="120">
        <template slot-scope="scope">{{ scope.row.date }}</template>
      </el-table-column>
      <el-table-column
        align="center"
        prop="name"
        label="姓名"
        width="120">
      </el-table-column>
      <el-table-column
        align="center"
        prop="address"
        label="地址"
        show-overflow-tooltip>
      </el-table-column>
       <el-table-column
        align="center"
        width="150"
        label="操作">
        <template slot-scope="scope">
        <i @click="view(scope.$index, scope.row)" class="el-icon-view myIconClass"></i>
        <i @click="edit(scope.$index, scope.row)" class="el-icon-edit myIconClass"></i>
        <i @click="del(scope.$index, scope.row)"  class="el-icon-delete myIconClass"></i>
      </template>
      </el-table-column>
    </el-table>
    <MyPagination></MyPagination>
  </div>
</template>

<script>
import MySearch from '../../components/search/mySearch'
import MyPagination from '../../components/pagination/myPagination'
export default {
  name: 'UserList',
  components: {
    MySearch,
    MyPagination
  },
  data () {
    return {
      tableData: [{
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-08',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-06',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-07',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-08',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-06',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-07',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }],
      multipleSelection: []
    }
  },
  methods: {
    handleSelectionChange (val) {
      this.multipleSelection = val
    }
  }
}
</script>

<style>
.el-table .cell{
  line-height: 2rem;
}
</style>
